package com.briup.jd2511.web04.exception;

import com.briup.jd2511.web04.util.ResultCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 业务层的自定义异常
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class ServiceException extends RuntimeException{
    private ResultCode resultCode;

    public ServiceException(String msg){
        super(msg);
    }
    public ServiceException(ResultCode resultCode){
        super(resultCode.getCode()+":"+resultCode.getMsg());
        // 赋值
        this.resultCode = resultCode;
    }
}
